home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / exec / openresource.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-12  |  1.5 KB  |  75 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: openresource.c,v 1.4 1996/08/13 13:56:05 digulla Exp $
  4.     $Log: openresource.c,v $
  5.     Revision 1.4  1996/08/13 13:56:05  digulla
  6.     Replaced __AROS_LA by __AROS_LHA
  7.     Replaced some __AROS_LH*I by __AROS_LH*
  8.     Sorted and added includes
  9.  
  10.     Revision 1.3  1996/08/01 17:41:15  digulla
  11.     Added standard header for all files
  12.  
  13.     Desc:
  14.     Lang: english
  15. */
  16. #include <exec/execbase.h>
  17. #include <exec/lists.h>
  18. #include <aros/libcall.h>
  19.  
  20. /*****************************************************************************
  21.  
  22.     NAME */
  23.     #include <exec/libraries.h>
  24.     #include <clib/exec_protos.h>
  25.  
  26.     __AROS_LH1(APTR, OpenResource,
  27.  
  28. /*  SYNOPSIS */
  29.     __AROS_LHA(STRPTR, resName, A1),
  30.  
  31. /*  LOCATION */
  32.     struct ExecBase *, SysBase, 83, Exec)
  33.  
  34. /*  FUNCTION
  35.     Return a pointer to a previously installed resource addressed by name.
  36.     It this name can't be found NULL is returned.
  37.  
  38.     INPUTS
  39.     libName - Pointer to the resource's name.
  40.  
  41.     RESULT
  42.     Pointer to resource or NULL.
  43.  
  44.     NOTES
  45.  
  46.     EXAMPLE
  47.  
  48.     BUGS
  49.  
  50.     SEE ALSO
  51.     AddResource(), RemResource()
  52.  
  53.     INTERNALS
  54.  
  55.     HISTORY
  56.  
  57. *****************************************************************************/
  58. {
  59.     __AROS_FUNC_INIT
  60.  
  61.     __AROS_BASE_EXT_DECL(struct ExecBase *,SysBase)
  62.     APTR resource;
  63.  
  64.     /* Arbitrate for the resource list */
  65.     Forbid();
  66.  
  67.     /* Look for the resource in our list */
  68.     resource = (APTR) FindName (&SysBase->ResourceList, resName);
  69.  
  70.     /* All done. */
  71.     Permit();
  72.     return resource;
  73.     __AROS_FUNC_EXIT
  74. } /* OpenResource */
  75.